// 页面路径：store/index.js
import { createStore } from 'vuex'
const store = createStore({
	state:{
		token:uni.getStorageSync('utoken') || '',
		userInfo:{},
	},
	mutations:{
		setToken (state,data) {
			state.token = data.token
			uni.setStorageSync('utoken',data.token)
		},
		clearCacheData (state) {
			state.token = ""
			uni.clearStorageSync()
		},
		getUserInfo (state,data) {
			state.userInfo = data	
		}
	},
	actions:{
		
	}
})

export default store